package cn.gok.hotelback.mapper;
import cn.gok.hotelback.entity.OrderAppendReview;
import org.apache.ibatis.annotations.*;
import java.util.List;
@Mapper
public interface OrderAppendReviewMapper {
    @Insert("INSERT INTO order_append_reviews (order_id, user_id, username, append_text) VALUES (#{orderId}, #{userId}, #{username}, #{appendText})")
    int insertAppendReview(OrderAppendReview appendReview);

    @Select("SELECT * FROM order_append_reviews WHERE order_id = #{orderId} ORDER BY append_time ASC")
    List<OrderAppendReview> selectByOrderId(@Param("orderId") String orderId);

    @Delete("DELETE FROM order_append_reviews WHERE order_id = #{orderId}")
    int deleteByOrderId(@Param("orderId") String orderId);

    @Delete("DELETE FROM order_append_reviews WHERE append_id = #{appendId}")
    int deleteByAppendId(@Param("appendId") Integer appendId);

    @Update("UPDATE order_append_reviews SET append_text = #{appendText} WHERE append_id = #{appendId}")
    int updateAppendReview(@Param("appendId") Integer appendId, @Param("appendText") String appendText);
} 